package com.leo.boot.feature;

import java.util.List;

import static cn.hutool.core.util.ReflectUtil.newInstance;
import static com.leo.boot.util.CommonUtils.uuid;

public interface Dimension<T extends Dimension<T>> {

    String getDimension();

    void setDimension(String dimension);

    List<T> getChildren();

    void setChildren(List<T> children);

    default String getId() {
        return uuid();
    }

    @SuppressWarnings("unchecked")
    default T reduce(T other) {
        return (T) newInstance(this.getClass());
    }
}
